credit
HTTP method: POST
Call the credit method to create a credit payment using a credit card, or a credit card token with the CVV code.
Test URL | https://testgateway.altapaysecure.com/merchant/API/<method> |
Production URL | https://<YourShopName>.altapaysecure.com/merchant/API/<method> |
These parameters are required for all payment methods.
For payment provider specific notes, see Payment methods and providers.
Parameter |
Description |
Type |
Mandatory |
---|---|---|---|
terminal |
The terminal determines the payment method and currency. For more information, see AltaPay's Payment Gateway. This is the title of your terminal, found under Home > Terminal Settings in the Merchant Interface. You can use variables in the terminal parameter. For example, if you want to call My EUR Terminal, you can set the terminal parameter value to 'My {currency} Terminal', where {currency} references the value of the currency parameter. |
string | X |
shop_orderid |
This is the internal ID of the order in your webshop. In most integrations, you can use the same order ID for up to four orders. The shop_orderid value is posted back to you, so you know which order the payment refers to. |
[a-zA-Z0-9-]{1,100} | X |
amount |
This is the payment amount. If you are setting up a subscription, amount is the default amount for each capture. You must use a dot as the decimal separator, and the amount can have maximum 2 decimals. |
float | X |
currency |
This is the payment currency. It must be specified in an ISO-4217 format, either using the 3-digit numeric code, or the 3-letter character code. For more information about ISO-4217 currency codes, see https://en.wikipedia.org/wiki/ISO_4217. |
[0-9]{3} or [A-Z]{3} |
X |
cardnum | The credit card number (PAN) | [0-9]{11-19} | You either need to send the credit_card_token parameter, or the cardnum, emonth, and eyear parameters. |
emonth | The expiry month | 01-12 | |
eyear | The expiry year | 2000-2999 | |
credit_card_token | This is the credit card token value. By using a credit card token from a previous payment, your customer won't have to enter credit card details again. To enable this, select the Enable credit card token check box under Home > Terminal Settings in the Merchant Interface. | [0-9a-f]{40} | |
cvc | The CVC/CVV/CVV2/Security Code | [0-9]{3-4} | |
transaction_info |
This is a one-dimensional associative array, where you can put any value that you would like to associate with the payment in the call to createPaymentRequest. |
Array Maximum 50 entries of maximum 255 characters each. |
|
payment_source |
This identifies the source of the payment. The default value is eCommerce. |
eCommerce mobi moto mail_order telephone_order |
|
The table shows the most pertinent response values for the method. For a complete list of API response parameters, see API Response structure (XML).
Parameter | Description |
---|---|
Result |
The result of the request, for example:
|
Transactions |
Contains a set of Transaction elements, each describing the relevant transactions. For more information, see Transaction. |
Example (based on new credit card)
An example of the form data for capturing a transaction based on a new credit card.
<form action="https://<YourShopName>.altapaysecure.com/merchant/API/credit/" method="post"> <input name="terminal" value="Terminal 1" /> <input name="shop_orderid" value="myorder123" /> <input name="amount" value="2499.95" /> <input name="currency" value="978" /> <input name="cardnum" value="4111111111111111" /> <input name="eyear" value="2017" /> <input name="emonth" value="12" /> <input name="cvc" value="123" /> <input type="submit">Submit</input> </form>
Example XML result
<APIResponse version="20170228"> <Header> <Date>2020-11-07T16:30:33+01:00</Date> <Path>API/credit/</Path> <ErrorCode>0</ErrorCode> <ErrorMessage/> </Header> <Body> <Result>Success</Result> <Transactions> <Transaction> <TransactionId>23550431</TransactionId> <PaymentId>5f7077d4-7668-4e2d-959f-21a6790bb4ef</PaymentId> <AuthType>credit</AuthType> <CardStatus>SoonExpired</CardStatus> <CreditCardExpiry> <Year>2030</Year> <Month>08</Month> </CreditCardExpiry> <CreditCardToken>2f632347a040071eeff022c1f1e698853ad1d968</CreditCardToken> <CreditCardMaskedPan>411111******1111</CreditCardMaskedPan> <CardInformation> <IsTokenized>false</IsTokenized> <Token>hYKu5yO33OsWYfT7g4weghvPjBnb3YEZYDysb7NzAf/sHk7j5j5ejzfF2ZyhLyggcCgaNKEmjg==+1</Token> <MaskedPan>411111******1111</MaskedPan> <Expiry> <Year>2030</Year> <Month>08</Month> </Expiry> <IssuingCountry>DK</IssuingCountry> <LastFourDigits>1111</LastFourDigits> <Scheme>VISA</Scheme> </CardInformation> <ThreeDSecureResult>Not_Attempted</ThreeDSecureResult> <LiableForChargeback>Merchant</LiableForChargeback> <CVVCheckResult>Not_Attempted</CVVCheckResult> <BlacklistToken>57c4f859a6b4e005bb1e7a42bd4cc7e8e4b58f1b</BlacklistToken> <ShopOrderId>myorder123</ShopOrderId> <Shop>Sander Improvement Software AB</Shop> <Terminal>Sander Improvement Software AB Test Terminal</Terminal> <TransactionStatus>credited</TransactionStatus> <ReasonCode>NONE</ReasonCode> <MerchantCurrency>978</MerchantCurrency> <MerchantCurrencyAlpha>EUR</MerchantCurrencyAlpha> <CardHolderCurrency>978</CardHolderCurrency> <CardHolderCurrencyAlpha>EUR</CardHolderCurrencyAlpha> <ReservedAmount>0.00</ReservedAmount> <CapturedAmount>0.00</CapturedAmount> <RefundedAmount>0.00</RefundedAmount> <CreditedAmount>2499.95</CreditedAmount> <RecurringDefaultAmount>0.00</RecurringDefaultAmount> <SurchargeAmount>0.00</SurchargeAmount> <CreatedDate>2017-11-07 16:30:32</CreatedDate> <UpdatedDate>2017-11-07 16:30:33</UpdatedDate> <PaymentNature>CreditCard</PaymentNature> <PaymentSchemeName>Visa</PaymentSchemeName> <PaymentNatureService name="SoapTestAcquirer"> <SupportsRefunds>true</SupportsRefunds> <SupportsRelease>true</SupportsRelease> <SupportsMultipleCaptures>true</SupportsMultipleCaptures> <SupportsMultipleRefunds>true</SupportsMultipleRefunds> </PaymentNatureService> <ChargebackEvents/> <PaymentInfos/> <CustomerInfo> <UserAgent/> <IpAddress/> <Email/> <Username/> <CustomerPhone/> <OrganisationNumber/> <CountryOfOrigin> <Country/> <Source>NotSet</Source> </CountryOfOrigin> <BillingAddress> <Firstname/> <Lastname/> <Address/> <City/> <Region/> <Country/> <PostalCode/> </BillingAddress> </CustomerInfo> <ReconciliationIdentifiers> <ReconciliationIdentifier> <Id>8bc0256b-2512-4269-b100-9d440031d98f</Id> <Amount currency="978">2499.95</Amount> <Type>credited</Type> <Date>2020-11-07T16:30:33+01:00</Date> </ReconciliationIdentifier> </ReconciliationIdentifiers> </Transaction> </Transactions> </Body> </APIResponse>
Use the following to test credit card transactions.
Scenario | Error type | Amount | Card Number |
---|---|---|---|
Fails at credit or createPaymentRequest with the appropriate type set. | Failed | 9.66 |
|
Fails at credit or createPaymentRequest with the appropriate type set. | Error | 9.67 |
|